package com.javajun.endofterm.entity;

import com.javajun.endofterm.common.CommonEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description: 用户权限类
 * Author: Xiong Limin
 * Date: 2020-11-28-6:11 下午
 */
@Entity
public class SysRole extends CommonEntity<Integer> {

    @Column(length = 50)
    private String name;

    @Column(length = 50)
    private String code;

    @ManyToMany(mappedBy = "sysRoleList")
    private List<SysUser> sysUserList = new ArrayList<>();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public List<SysUser> getSysUserList() {
        return sysUserList;
    }

    public void setSysUserList(List<SysUser> sysUserList) {
        this.sysUserList = sysUserList;
    }

    @Override
    public String toString() {
        return "SysRole{" +
                "name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", sysUserList=" + sysUserList +
                '}';
    }
}
